﻿@using DPUWebPhet10.Helpers
@model DPUWebPhet10.Models.TB_APPLICATION_SCHOOL
@{
    ViewBag.Title = "Edit";
}
<div id="stylized" class="myform">
@using (Html.BeginForm("School/Edit")) {
    @Html.ValidationSummary(true)
        <div class="form">

        @Html.HiddenFor(model => model.SCHOOL_ID)
        @Html.HiddenFor(model => model.SCHOOL_PASSWORD)
        @Html.HiddenFor(model => model.SCHOOL_DOC_PATH)
        @Html.HiddenFor(model => model.SCHOOL_REGISTER_DATE)
        @Html.HiddenFor(model => model.SCHOOL_APPROVED_STATUS)

        @if(@HttpContext.Current.Session["PhetCulture"].ToString().Equals("en"))
        {
            <!-- English Application Form -->
@*            <fieldset>
                <legend>@DPUWebPhet10.Resources.Common.Common.LB013</legend>*@
                <p>
                    <!-- School Name -->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_NAME)
                    @Html.AutocompleteFor(model => model.SCHOOL_NAME, "Autocomplete", "Application")
                    @Html.ValidationMessageFor(model => model.SCHOOL_NAME)
                </p>
                <p>
                    <!-- School Type -->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_TYPE)
                    @Html.DropDownList("SCHOOL_TYPE", "-- Select --")
                </p>
                <p>
                    <!-- Other -->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_TYPE_OTHER)
                </p>
                <p>
                    <!-- Address -->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_ADDR)
                    @Html.TextAreaFor(model => model.SCHOOL_ADDR)
                    @Html.ValidationMessageFor(model => model.SCHOOL_ADDR)
                </p>
                <p>
                    <!-- Phone -->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_ADDR_PHONE)
                    @Html.EditorFor(model => model.SCHOOL_ADDR_PHONE)
                    @Html.ValidationMessageFor(model => model.SCHOOL_ADDR_PHONE)
                    <!-- Fax -->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_ADDR_FAX)
                    @Html.EditorFor(model => model.SCHOOL_ADDR_FAX)
                    @Html.ValidationMessageFor(model => model.SCHOOL_ADDR_FAX)
                </p>
                <p>
                    <!-- Email -->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_EMAIL)
                    @Html.EditorFor(model => model.SCHOOL_EMAIL)
                    @Html.ValidationMessageFor(model => model.SCHOOL_EMAIL)
                </p>
@*            </fieldset>*@
        }
        else if (@HttpContext.Current.Session["PhetCulture"].ToString().Equals("zh"))
        {
            <!-- Chaina Application Form -->
@*            <fieldset class="row1">
                <<legend>@DPUWebPhet10.Resources.Common.Common.LB013</legend>*@
                <p>
                    <!-- School Name -->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_NAME)
                    @Html.AutocompleteFor(model => model.SCHOOL_NAME, "Autocomplete", "Application")
                    @Html.ValidationMessageFor(model => model.SCHOOL_NAME)
                    <!-- Educationi Zone-->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_ZONE_EDU)
                    @Html.EditorFor(model => model.SCHOOL_ZONE_EDU)
                    @Html.ValidationMessageFor(model => model.SCHOOL_ZONE_EDU)
                </p>
                <p>
                    <!-- Zone-->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_ZONE)
                    @Html.EditorFor(model => model.SCHOOL_ZONE)
                    @Html.ValidationMessageFor(model => model.SCHOOL_ZONE)
                </p>
                <p>
                    <!-- School Type -->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_TYPE)
                    @Html.DropDownList("SCHOOL_TYPE", "-- Select --")
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_TYPE_OTHER)
                    <!-- Other -->
                    @Html.EditorFor(model => model.SCHOOL_TYPE_OTHER)
                    @Html.ValidationMessageFor(model => model.SCHOOL_TYPE_OTHER)
                </p>
                <p>
                    <!-- Address -->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_ADDR)
                    @Html.TextAreaFor(model => model.SCHOOL_ADDR)
                    @Html.ValidationMessageFor(model => model.SCHOOL_ADDR)
                </p>

                <p>
                    <!-- Phone -->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_ADDR_PHONE)
                    @Html.EditorFor(model => model.SCHOOL_ADDR_PHONE)
                    @Html.ValidationMessageFor(model => model.SCHOOL_ADDR_PHONE)
                    <!-- Fax -->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_ADDR_FAX)
                    @Html.EditorFor(model => model.SCHOOL_ADDR_FAX)
                    @Html.ValidationMessageFor(model => model.SCHOOL_ADDR_FAX)

                </p>
                <p>
                    <!-- Email -->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_EMAIL)
                    @Html.EditorFor(model => model.SCHOOL_EMAIL)
                    @Html.ValidationMessageFor(model => model.SCHOOL_EMAIL)
                </p>
@*            </fieldset>*@
        }
        else
        {
            <!-- Thai Application Form -->
@*            <fieldset class="row1">
                <legend>@DPUWebPhet10.Resources.Common.Common.LB013</legend>*@
@*                <p>*@
                    <!-- School Name -->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_NAME)
                    @Html.AutocompleteFor(model => model.SCHOOL_NAME, "Autocomplete", "Application")
                    @Html.ValidationMessageFor(model => model.SCHOOL_NAME)
@*                </p>
                <p>*@
                    <!-- Educationi Zone-->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_ZONE_EDU)
                    @Html.EditorFor(model => model.SCHOOL_ZONE_EDU)
                    @Html.ValidationMessageFor(model => model.SCHOOL_ZONE_EDU)
    @*            </p>*@
                <p>
                    <!-- Zone-->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_ZONE)
                    @Html.EditorFor(model => model.SCHOOL_ZONE)
                    @Html.ValidationMessageFor(model => model.SCHOOL_ZONE)
                </p>
                <p>
                    <!-- Province -->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_PROVINCE)
                    @Html.DropDownList("SCHOOL_PROVINCE", "-- Select --")
                    @Html.ValidationMessageFor(model => model.SCHOOL_PROVINCE)
                </p>
                <p>
                    <!-- School Type -->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_TYPE)
                    @Html.DropDownList("SCHOOL_TYPE", "-- Select --")
@*                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_TYPE_OTHER)*@
                    <!-- Other -->
                    @Html.EditorFor(model => model.SCHOOL_TYPE_OTHER)
                    @Html.ValidationMessageFor(model => model.SCHOOL_TYPE_OTHER)
                </p>
                <p>
                    <!-- Address -->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_ADDR)
                    @Html.EditorFor(model => model.SCHOOL_ADDR)
                    @Html.ValidationMessageFor(model => model.SCHOOL_ADDR)
                </p>
                <p>
                    <!-- soi -->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_ADDR_SOI)
                    @Html.EditorFor(model => model.SCHOOL_ADDR_SOI)
                    @Html.ValidationMessageFor(model => model.SCHOOL_ADDR_SOI)
                </p>
                <p>
                    <!-- road -->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_ADDR_ROAD)
                    @Html.EditorFor(model => model.SCHOOL_ADDR_ROAD)
                    @Html.ValidationMessageFor(model => model.SCHOOL_ADDR_ROAD)
                </p>
                <p>
                    <!-- Province -->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_ADDR_PROVINCE)
                    @Html.DropDownList("SCHOOL_ADDR_PROVINCE","-- Select --")
                </p>
                <p>
                    <!-- Amphur -->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_ADDR_AMPHUR)
                    @Html.DropDownList("SCHOOL_ADDR_AMPHUR", "-- Select --")
                    @Html.ValidationMessageFor(model => model.SCHOOL_ADDR_AMPHUR)
                </p>
                <p>
                    <!-- Tombon -->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_ADDR_TOMBON)
                    @Html.DropDownList("SCHOOL_ADDR_TOMBON", "-- Select --")
                </p>
                <p>
                    <!-- Zipcode -->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_ADDR_ZIPCODE)
                    @Html.EditorFor(model => model.SCHOOL_ADDR_ZIPCODE)
                    @Html.ValidationMessageFor(model => model.SCHOOL_ADDR_ZIPCODE)
                </p>
                <p>
                    <!-- Phone -->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_ADDR_PHONE)
                    @Html.EditorFor(model => model.SCHOOL_ADDR_PHONE)
                    @Html.ValidationMessageFor(model => model.SCHOOL_ADDR_PHONE)
                </p>
                <p>
                    <!-- Fax -->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_ADDR_FAX)
                    @Html.EditorFor(model => model.SCHOOL_ADDR_FAX)
                    @Html.ValidationMessageFor(model => model.SCHOOL_ADDR_FAX)
                </p>
                <p>
                    <!-- Email -->
                    @Html.Label(@DPUWebPhet10.Resources.School.School.SCHOOL_EMAIL)
                    @Html.EditorFor(model => model.SCHOOL_EMAIL)
                    @Html.ValidationMessageFor(model => model.SCHOOL_EMAIL)
                </p>
@*            </fieldset>*@
        
        }
        </div>
        <p>
            <input type="submit" value="Save" />
        </p>

}
</div>
<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
    @Scripts.Render("~/bundles/jqueryui")
    @Styles.Render("~/Content/themes/base/css")
    <script type="text/javascript">
        $(document).ready(function () {

            //Attach cascading behavior to the amphur select element.
            $("#SCHOOL_ADDR_AMPHUR").CascadingDropDown("#SCHOOL_ADDR_PROVINCE", '/School/AsyncAmphurs',
            {
                promptText: '-- Pick an Amphur --',
                onLoading: function () {
                    $(this).css("background-color", "#ff3");
                },
                onLoaded: function () {
                    $(this).animate({ backgroundColor: '#ffffff' }, 300);
                }
            });

            //Attach cascading behavior to the district select element.
            $("#SCHOOL_ADDR_TOMBON").CascadingDropDown("#SCHOOL_ADDR_AMPHUR", '/School/AsyncDistricts',
            {
                promptText: '-- Pick District --',
                onLoading: function () {
                    $(this).css("background-color", "#ff3");
                },
                onLoaded: function () {
                    $(this).animate({ backgroundColor: '#ffffff' }, 300);

                }
            });

        });
    </script>
}
